<template>
  <div>
    <a-row :gutter="48">
      <a-col :md="8"
             :sm="24">
        英文标识：{{enname}}
      </a-col>
      <a-col :md="8"
             :sm="24">
        枚举含义：{{description}}
      </a-col>
      <a-col :md="8"
             :sm="24">
        枚举组ID：{{enumid}}
      </a-col>
    </a-row>
    <a-table :columns="columns"
             :data-source="enumData"
             :pagination=false
             rowKey="id"
             style="margin-top:30px">
      <span slot="serial"
            slot-scope="text, record, index">
        {{ index + 1 }}
      </span>
    </a-table>
  </div>
</template>
<script>
import { queryEnumerationValueList } from '@/api/base/enumeration'

const columns = [
  {
    title: '序号',
    scopedSlots: { customRender: 'serial' }
  },
  {
    title: '英文标识',
    dataIndex: 'valuename',
    key: 'valuename'
  },
  {
    title: '枚举含义',
    dataIndex: 'description',
    key: 'description'
  },
  {
    title: '枚举项ID',
    dataIndex: 'id',
    key: 'id'
  }
]

export default {
  props: ['enname', 'description', 'enumid'],
  data () {
    return {
      columns,
      enumData: []// 表格数据
    }
  },
  methods: {
    getList (enumid) {
      const param = { 'f_enumeration': enumid }
      queryEnumerationValueList(param).then((res) => {
        console.log("枚举-----------", res)
        this.enumData = res.data.records
      })
    }
  }
}
</script>
